package com.cm.projectx.controller.pricetask;

import com.cm.projectx.response.Result;
import com.cm.projectx.service.IdkTemplateTypesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/v2api/price/templateTypes")
@RestController
@Slf4j
public class TemplateTypesController {

    @Autowired
    private IdkTemplateTypesService service;

    /**
     * 模板下拉列表
     * @return
     */
    @RequestMapping("list")
    public Result templateTypeList(){
        Result result = new Result();
        result.setCode(0);
        result.setMsg("业务成功");
        result.addData("list",  service.getTemplateTypeList());
        return result;
    }

    /**
     * 根据模板code查询对应的指标信息
     */

    @GetMapping("getByTemplateCode")
    public Result getByTemplateCode(@RequestParam String TemplateCode){
        Result result = new Result();
        result.setCode(0);
        result.setMsg("业务成功");
        result.addData("list",  service.getByTemplateCode(TemplateCode));
        return result;
    }

}
